package com.reform.pojo.project;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;

import com.baomidou.mybatisplus.annotation.TableField;

import java.io.Serializable;
import java.time.LocalDate;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.reform.utils.VerifycUtils;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.validation.annotation.Validated;

/**
 * <p>
 * 阶段时间表
 * </p>
 *
 * @author mortale
 * @since 2021-07-15
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@Validated
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("phase_time")
@ApiModel(value = "PhaseTime对象", description = "阶段时间表")
public class PhaseTime implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "阶段检查编号")
    @TableId(value = "phase_id")
    private String phaseId;

    @ApiModelProperty(value = "批次编号")
    @TableField("batch_id")
    private String batchId;

    @ApiModelProperty(value = "名称")
    @TableField("phase_name")
    private String phaseName;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "教师申报开始时间(yyyy-MM-dd)")
    @TableField(value = "phase_teacher_start", fill = FieldFill.UPDATE)
    private LocalDate phaseTeacherStart;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "教师申报结束时间(yyyy-MM-dd)")
    @TableField(value = "phase_teacher_end", fill = FieldFill.UPDATE)
    private LocalDate phaseTeacherEnd;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "学院检查开始时间(yyyy-MM-dd)")
    @TableField(value = "phase_department_start", fill = FieldFill.UPDATE)
    private LocalDate phaseDepartmentStart;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "学院检查结束时间(yyyy-MM-dd)")
    @TableField(value = "phase_department_end", fill = FieldFill.UPDATE)
    private LocalDate phaseDepartmentEnd;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "学校检查一审开始时间(yyyy-MM-dd)")
    @TableField(value = "phase_school_first_start", fill = FieldFill.UPDATE)
    private LocalDate phaseSchoolFirstStart;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "学校检查一审结束时间(yyyy-MM-dd)")
    @TableField(value = "phase_school_first_end", fill = FieldFill.UPDATE)
    private LocalDate phaseSchoolFirstEnd;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "专家检查开始时间(yyyy-MM-dd)")
    @TableField(value = "phase_expert_start", fill = FieldFill.UPDATE)
    private LocalDate phaseExpertStart;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "专家检查结束时间(yyyy-MM-dd)")
    @TableField(value = "phase_expert_end", fill = FieldFill.UPDATE)
    private LocalDate phaseExpertEnd;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "学校检查二审开始时间(yyyy-MM-dd)")
    @TableField(value = "phase_school_second_start", fill = FieldFill.UPDATE)
    private LocalDate phaseSchoolSecondStart;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @ApiModelProperty(value = "学校检查二审结束时间(yyyy-MM-dd)")
    @TableField(value = "phase_school_second_end", fill = FieldFill.UPDATE)
    private LocalDate phaseSchoolSecondEnd;

    @ApiModelProperty(value = "上传打分表模板地址")
    @TableField("score_path")
    private String scorePath;

    @ApiModelProperty(value = "打分表模板文件名")
    @TableField("score_path_name")
    private String scorePathName;

    @ApiModelProperty(value = "上传材料模板地址")
    private String path;

    @ApiModelProperty(value = "材料模板名")
    @TableField("path_name")
    private String pathName;

    @ApiModelProperty(value = "类型(1 =>立项  2 => 中期   3=>结项)")
    private Integer type;

    @ApiModelProperty(value = "批次状态（-1 申报 0学院审核 1学校初审 2专家审核 3学校二审）")
    private Integer status;

    public PhaseTime(String phaseId, String batchId, String phaseName, LocalDate phaseTeacherStart, LocalDate phaseTeacherEnd, LocalDate phaseDepartmentStart, LocalDate phaseDepartmentEnd, LocalDate phaseSchoolFirstStart, LocalDate phaseSchoolFirstEnd, LocalDate phaseExpertStart, LocalDate phaseExpertEnd, LocalDate phaseSchoolSecondStart, LocalDate phaseSchoolSecondEnd, Integer type, Integer status) {
        this.phaseId = phaseId;
        this.batchId = batchId;
        this.phaseName = phaseName;
        this.phaseTeacherStart = phaseTeacherStart;
        this.phaseTeacherEnd = phaseTeacherEnd;
        this.phaseDepartmentStart = phaseDepartmentStart;
        this.phaseDepartmentEnd = phaseDepartmentEnd;
        this.phaseSchoolFirstStart = phaseSchoolFirstStart;
        this.phaseSchoolFirstEnd = phaseSchoolFirstEnd;
        this.phaseExpertStart = phaseExpertStart;
        this.phaseExpertEnd = phaseExpertEnd;
        this.phaseSchoolSecondStart = phaseSchoolSecondStart;
        this.phaseSchoolSecondEnd = phaseSchoolSecondEnd;
        this.type = type;
        this.status = status;
    }
}
